import org.apache.commons.beanutils.BeanUtils;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;

import javax.security.auth.login.AppConfigurationEntry;
import java.io.IOException;
import java.nio.file.Paths;

public class mrTest {
    public static void main(String[] args) throws IOException ,ClassNotFoundException, InterruptedException{
        Configuration entries = new Configuration();
        Job job = Job.getInstance(entries);
        job.setJarByClass(mrTest.class);
        job.setMapperClass(mapperTest.class);
        job.setReducerClass(reduceTest.class);
        job.setMapOutputKeyClass(Text.class);
        job.setMapOutputValueClass(IntWritable.class);
        job.setOutputKeyClass(IntWritable.class);
        job.setOutputValueClass(IntWritable.class);
        job.setNumReduceTasks(1);
        FileInputFormat.setInputPaths(job,new Path("D:\\大数据作业\\zhao-zheles-code-warehouse\\code\\第七模块\\验证资料\\input\\*.txt"));
        FileOutputFormat.setOutputPath(job,new Path("D:\\大数据作业\\zhao-zheles-code-warehouse\\code\\第七模块\\验证资料\\output"));
        boolean result = job.waitForCompletion(true);
        System.exit(result?0:1);


    }
}
